{% extends 'rbac/base.html' %}
{% block addcss %}
    <style>
        .table-size {
            font-size: 13px;
        }

        .w {
            padding-bottom: 10px;
        }

        .screen {
            margin: 10px 15px;
        }

        .whole {
            font-weight: bold;
            font-size: 14px;
            line-height: 14px;
            padding-top: 9px;
        }

        .others a {
            margin-right: 5px;
        }
    </style>
{% endblock %}
{% block content %}
    {% load menu %}
    {% breadcrumb request %}

    <div class="wrapper wrapper-content animated fadeInRight">
        <div class="row">
            <div class="col-lg-12">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <h5>
                            {% with request.breadcrumb|last as last %}
                                {{ last.title }}
                            {% endwith %}
                        </h5>
                        <div class="ibox-tools">
                        </div>
                    </div>


                    <div class="ibox-content">


                        {% csrf_token %}
                        <div class="w form-inline">

                        </div>
                        <div class="table-responsive">

                            <table class="table table-striped table-bordered table-hover text-center table-size">
                                <thead>
                                <tr>
                                    {% for item in table_head %}
                                        <th>{{ item }}</th>
                                    {% endfor %}
                                </tr>
                                </thead>
                                <tbody>
                                {% for row in table_body %}
                                    <tr>
                                        {% for data in row %}
                                            <td>{{ data }}</td>
                                        {% endfor %}
                                    </tr>
                                {% endfor %}
                                </tbody>
                            </table>
                        </div>

                        {#                    分页表#}
                        <div class="col-sm-12 clearfix">
                            <ul class="pagination float-right">
                                {{ pager.page_html|safe }}
                            </ul>
                        </div>

                    </div>
                </div>
            </div>
        </div>
    </div>
{% endblock %}

{% block addjs %}
    <script>
        $(document).ready(function () {
            $('#approval').on("click", function () {
                var upfileinfo = $(this).attr('upfileinfo');
                $.ajax({
                    url: '{% url "Arc:project_project_approval"  %}',
                    type: 'POST',
                    data: {
                        'upfileinfo': upfileinfo,
                        'csrfmiddlewaretoken': $('input[name="csrfmiddlewaretoken"]').val(),
                    },
                    success: function (data) {
                        if (data['status']) {
                            window.location.reload()
                        } else {
                            alert(data['msg']);
                        }
                    },

                })
            })
        });
    </script>

{% endblock %}
